home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / ebl405.zip / BATDEMO.BAT < prev    next >
DOS Batch File  |  1990-03-05  |  17KB  |  519 lines

  1. bat * Loading DEMO .....
  2. *           Written by F.Canova 10/5/83 through 01/25/90
  3. *   (c) Copyright 1983-1990 by Seaware Corp. all rights reserved.
  4. *    This batch file REQUIRES EBL PLUS for proper execution!
  5.  
  6. ********************* NOTE! NOTE! NOTE! NOTE! ********************
  7. %D = 'RAM'    |* <-----Change 'RAM' to 'BIOS' if PC isn't 100% IBM Compatible!
  8. goto -start
  9. * For more information or to receive your own copy of EBL PLUS write to:
  10. *              Seaware Corp.
  11. *              P.O. Box 1656
  12. *              Delray Beach, FL 33444
  13.  
  14. *---- FEATURES OF THE LANGUAGE USED WITHIN THIS DEMO ARE: ----------------
  15. * Standard DOS commands can be intermixed freely with BAT commands.
  16. * Up to 255 chars are allowed for labels, contents of vars, and literals
  17. * 10 variables are provided to be passed to/from DOS. They're %0 to %9.
  18. * 15 variables are provided for EBL PLUS┐ user use only. They're %A to %O.
  19. * The variable %R is a return code that any routine can set at [0:04FE]
  20. * BEGTYPE command can have screen attributes via the COLORCHAR command,
  21. * or the '\hex' format.
  22. * BEGSTACK command can have timing attributes via the KEY(PAUSE) or
  23. * the alternative '\hex' format.
  24. * Spaces are not needed to delimit operators.
  25. * Non-spaces will concatenate variables and literals.
  26. * EXIST() and DIR() set a return code based on state of a file's existence.
  27.  
  28.         ** Now actually do the bouncing bar menu **
  29. -End1    type " Exit to DOS                " | If %A = Enter then goto -Bye
  30. -Endit    %A = select( color( yellow on blue), color( black on white ), Arrow)
  31.     if %A = Esc then goto -line0
  32.     if %R = 1 then goto -End1
  33. -End2    if %R = 2 type " Go to on-line documentation" | If %A = Enter then stack "BATDOC" |exit
  34. -End3    if %R = 3 type " Return to EBL Plus demo    " | If %A = Enter then goto -top
  35.        goto -endit
  36.  
  37. -Bye    window( 19, 14, 49, 21)
  38.     type "So long" %F....
  39.     type "P.S. For quickie help,"
  40.     type " just enter 'BAT' from DOS!"
  41.     exit
  42.  
  43. -start
  44.     if %D = 'RAM' then RAM
  45.     else BIOS
  46.  
  47. ** Open the demo with welcome message windows in the shape of a big 'W' **
  48. *   play( o5 t140 ms l8 g4 p >c <b >c p6 <e p6 d p6 b p6 >c..)
  49. *   repeat with %0 = 1 to 27
  50. *    color ((%0 % 8) & "F")
  51. *    if %0 < 7        then %1 = %0 * 2
  52. *       else if %0 < 14  then %1 = (14 - %0) * 2
  53. *       else if %0 < 21  then %1 = (%0 - 13) * 2
  54. *       else          %1 = (28 - %0) * 2
  55. *    window( (%0*2), %1, (%0*2+20), (%1+5), s)
  56. *    type
  57. *    type center("Welcome", 18)
  58. *   end repeat
  59. *   wait until time(2)
  60.  
  61. ** Start by asking who I'm talking to **
  62.     colorchar '=' as color( yellow on white )
  63.     colorchar '@' as color( white on blue )
  64.     colorchar '`' as color( blink white on blue )
  65.     color( black on white )
  66.     cls
  67.     begtype
  68.           =(Non-IBM systems, read NOTE within this file)=
  69.  
  70.   @┌───────────────────────────────────────────────────────────────────────┐@
  71.   @│          EXTENDED BATCH LANGUAGE-PLUS                   │@
  72.   @│                                       │@
  73.   @│    Welcome to the Extended Batch Language Plus Demonstration !       │@
  74.   @│                                       │@
  75.   @└───────────────────────────────────────────────────────────────────────┘@
  76. end
  77. call -asplogo 40 16
  78. color( white on black )
  79. locate 13 10 | Type "What is your first name? ;"
  80. read %F
  81. %7 = 27
  82. %L =
  83. %0 = left( (" " & %F & "'s EBL Plus Sampler Menu"), 47)
  84.  
  85. -top ** Show Master Menu of things that can be shown **
  86.     color( Normal )
  87.     colorchar
  88.     colorchar '@' as color( white on blue )
  89.     colorchar '^' as color( lgray on blue )
  90.     colorchar '#' as color( black on cyan )
  91.     colorchar '&' as color( yellow on red )
  92.     colorchar '*' as color( white on red )
  93.     cls begtype
  94. @════════════════════════════════════════════════@ ^┌─────────────────────────┐^
  95. @ \%0@ ^│ User supported software │^
  96. @════════════════════════════════════════════════@ ^│           by          │^
  97.                            ^│                  │^
  98.                            ^│ Seaware Corp.          │^
  99.  # C #────&I can Count                 & ^│ P.O. Box 1656          │^
  100.       *                     * ^│ Delray Beach, FL 33444  │^
  101.  # D #────&Directory of available programs     & ^│ 407/392-2046          │^
  102.       *                     * ^│                  │^
  103.  # F #────&Testing for Files             & ^│ Order your registered   │^
  104.       *                     * ^│ copy for $79 from us    │^
  105.  # K #────&Keyboard stack (the invisible fingers)& ^│ directly or our order   │^
  106.       *                     * ^│ line at 800/634-8188    │^
  107.  # S #────&Display Screen and String operations  & ^│                  │^
  108.       *                     * ^│ Please copy and share   │^
  109.  # X #────&eXit                  & ^│ BAT.COM, BATDOC.BAT,    │^
  110.                            ^│ and BATDEMO.BAT for     │^
  111.                            ^│ non-commercial uses     │^
  112.                            ^│ only.              │^
  113.                            ^│                  │^
  114.                            ^│ ASP member.          │^
  115. (Select a demo with the cursor and press ─┘)       ^└─────────────────────────┘^
  116. end
  117.     colorchar
  118.     colorchar '@' as color( white on blue )
  119. -Entry
  120.     color( yellow on black)
  121.     %9 = ''
  122.  
  123. -Text.1 *** (C)ount
  124.     locate 1 18
  125.     type " This is a simple game that shows the math    "
  126.     type " and looping capabilities of EBL Plus.        "
  127.     if %9 = Enter then call -i.can.count | goto -top
  128.  
  129. -Choose
  130.     %7 = %7 + 3
  131.     %9 = select(color(yellow on red),color(black on white),Arrow)
  132.  
  133.     if %9 = 'C' then %9 = Enter
  134.     if %9 = 'D' then %9 = Enter
  135.     if %9 = 'F' then %9 = Enter
  136.     if %9 = 'K' then %9 = Enter
  137.     if %9 = 'S' then %9 = Enter
  138.     if %9 = 'X' then %9 = Enter
  139.     locate 1 18
  140.     if %R = 1 then goto -Text.1
  141.     if %R <> 2 then skip 4
  142.     type " See how EBL Plus can work together with your "
  143.     type " application and DOS.                         "
  144.     if %9 = Enter then call -dgo | goto -top
  145.           else goto -Choose
  146.     if %R <> 3 then skip 4
  147.     type " EBL Plus can see files that are created by   "
  148.     type " your programs, or create new ones on it own. "
  149.     if %9 = Enter then call -fgo | goto -top
  150.           else goto -Choose
  151.     if %R <> 4 then skip 4
  152.     type " EBL Plus can automatically control your      "
  153.     type " applications by typing on the keyboard.      "
  154.     if %9 = Enter then call -kgo | goto -top
  155.           else goto -Choose
  156.     if %R <> 5 then skip 4
  157.     type " See how EBL Plus makes your screen come alive"
  158.     type " with color and powerful string handling.     "
  159.     if %9 = Enter then call -sgo | goto -top
  160.           else goto -Choose
  161.     else
  162.     type " Leave this Demo and return to DOS            "
  163.     type "                                              "
  164.     if %9 = Enter then goto -exit
  165.           else goto -Choose
  166.  
  167. *******************************************************************************
  168.  
  169. * number guessing demo *
  170. -i.can.count
  171.     cls type "I am thinking of a two digit number, can you guess it?"
  172.     %J=tries
  173.     %7 = right(%7,2) + 0        |* Limit to just 2 digits!
  174.     repeat with %A = 4 down to 0
  175.     read %5
  176.     if %5 = %7
  177.     begin
  178.         type "Great!  I was afraid you weren't going to get it!"
  179.         exit repeat
  180.     end
  181.     if %A = 1 then %J = try
  182.     if %A = 0
  183.     begin
  184.         type "BOO HISSS!  The number was" %7 "!"
  185.         exit repeat
  186.     end
  187.     if %5 > %7 type "Try a little lower.  You get" %A "more" %J.
  188.     if %5 < %7 type "Try a higher number.  You get" %A "more" %J.
  189.     end repeat
  190.     begtype
  191. @════════════════════════════════════════════════════════════════════════════@
  192.   A BAT program can create loops and count events.  With this you can
  193.   sequence through file numbers, or create loops to do retries in case of
  194.   errors.  The REPEAT commands are handy for this.  EBL programs can even
  195.   do arithmetic (up to 18 digits) and string manipulation (up to 255
  196.   characters mixed case).  In addition, the external function BATMATH3,
  197.   (or alternate BATMATH87 for use with the 8087 co-processor) is provided
  198.   to registered users when floating point math is needed.
  199. @════════════════════════════════════════════════════════════════════════════@
  200.  
  201. Press any key to continue. . .
  202.  
  203. end
  204. inkey
  205. return
  206.  
  207. *******************************************************************************
  208.  
  209. * directory demo *
  210. -dgo
  211.     color( White )
  212.     cls
  213.     type "Enter file.spec for files you would like to see,"
  214.     read or press ENTER for all: %1
  215.     if .%1 = '.' then %1 = '*.*'
  216.     -dirques
  217.     colorchar . as color( yellow on black )
  218.     type "Would you like a .S.tandard or .W.ide directory?"
  219.     select( color(yellow on black))
  220.     colorchar .